//
//  TCMydetailSecondTableViewCell.m
//  Project_B
//
//  Created by dllo on 15/11/26.
//  Copyright © 2015年 张闯. All rights reserved.
//

#import "TCMydetailSecondTableViewCell.h"
#import "UIImageView+WebCache.h"
#define WIDTH [[UIScreen mainScreen] bounds].size.width / 375
#define HEIGHT [[UIScreen mainScreen] bounds].size.height / 667
@implementation TCMydetailSecondTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.smallimage = [[UIImageView alloc]init];
        [self.contentView addSubview:self.smallimage];
        
        self.namelabel = [[UILabel alloc]init];
        [self.namelabel setFont:[UIFont systemFontOfSize:13]];
        self.namelabel.textColor = [UIColor grayColor];
        [self.contentView addSubview:self.namelabel];
        
        self.timelabel = [[UILabel alloc]init];
        [self.timelabel setFont:[UIFont systemFontOfSize:13]];
        self.timelabel.textColor = [UIColor grayColor];
        [self.contentView addSubview:self.timelabel];
        
        self.foollabel = [[UILabel alloc]init];
        [self.foollabel setFont:[UIFont systemFontOfSize:13]];
        self.foollabel.textColor = [UIColor grayColor];
        self.foollabel.textAlignment = NSTextAlignmentRight;
        [self.contentView addSubview:self.foollabel];
        
        self.contextlabel = [[UILabel alloc]init];
        self.contextlabel.textColor = [UIColor grayColor];
        [self.contextlabel setFont:[UIFont systemFontOfSize:13.5]];
        [self.contentView addSubview:self.contextlabel];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.smallimage.frame = CGRectMake(10*WIDTH, 10*HEIGHT, 40*WIDTH, 40*HEIGHT);
    self.namelabel.frame = CGRectMake(75*WIDTH, 10*HEIGHT, 150*WIDTH, 30*HEIGHT);
    self.timelabel.frame = CGRectMake(75*WIDTH, 40*HEIGHT, 150*WIDTH, 30*HEIGHT);
    self.foollabel.frame = CGRectMake(280*WIDTH, 10*HEIGHT, 80*WIDTH, 40*HEIGHT);
    self.contextlabel.frame = CGRectMake(10*WIDTH, 85*HEIGHT, 355*WIDTH, 40*HEIGHT);
}
- (void)setTemp:(TCdetailRoute *)temp
{
    if (self.temp != temp) {
        _temp = temp;
    }
    [self.smallimage sd_setImageWithURL:[NSURL URLWithString:temp.headicon] placeholderImage:[UIImage imageNamed:@"zhanwei.png"]];
    self.namelabel.text = temp.nickname;
    self.timelabel.text = temp.createdate;
    self.foollabel.text = [NSString stringWithFormat:@"%@楼",temp.floor];
    self.contextlabel.text = temp.content;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
